﻿// See https://aka.ms/new-console-template for more information

using AlibabaCloud.SDK.Dysmsapi20170525;
using ShortMessage;
using Tea;
using Tea.Utils;

Client client = AliyunMsg.CreateClient("LTAI4G86Wm3bmzMXfC5enAWG", "mtCxpifLrNwMrNswONfNoi38eLWbxh");
AlibabaCloud.SDK.Dysmsapi20170525.Models.SendSmsRequest sendSmsRequest = new AlibabaCloud.SDK.Dysmsapi20170525.Models.SendSmsRequest
{
    SignName = "阿喵短信测试",
    TemplateCode = "SMS_154950909",
    PhoneNumbers = "17620372030",
    TemplateParam = "{\"code\":\"4321\"}",
};
var runtime = new AlibabaCloud.TeaUtil.Models.RuntimeOptions();
try
{
    // 复制代码运行请自行打印 API 的返回值
    client.SendSmsWithOptions(sendSmsRequest, runtime);
}
catch (TeaException error)
{
    // 如有需要，请打印 error
    AlibabaCloud.TeaUtil.Common.AssertAsString(error.Message);
}
catch (Exception _error)
{
    TeaException error = new TeaException(new Dictionary<string, object>
                {
                    { "message", _error.Message }
                });
    // 如有需要，请打印 error
    AlibabaCloud.TeaUtil.Common.AssertAsString(error.Message);
}
       
Console.WriteLine("Hello, World!");
